const routes = [
  {
    path: "/login-register",
    component: () => import("@/views/login-register/index.vue"),
    meta: { title: "登录/注册", requiresAuth: false, isShowNav: false },
  },
  {
    path: "/",
    component: () => import("@/views/index.vue"),
    redirect: "/index",
    meta: { isShowNav: false },
    children: [
      {
        path: "/index",
        component: () => import("@/views/home/index.vue"),
        meta: { title: "首页", requiresAuth: true, isShowNav: true },
      },
      {
        path: "/gamemanage",
        redirect: "/gamemanage/gamelist",
        component: () => import("@/views/manage/index.vue"),
        meta: {
          title: "游戏管理",
          requiresAuth: true,
          menu: "游戏管理列表目录",
          isShowNav: true,
        },
        children: [
          {
            path: "gamelist",
            component: () => import("@/views/manage/gameM/gameList/index.vue"),
            meta: { title: "游戏列表", requiresAuth: true, isShowNav: true },
          },
          {
            path: "gamepublish",
            component: () =>
              import("@/views/manage/gameM/gamePublish/index.vue"),
            meta: { title: "游戏发布", requiresAuth: true, isShowNav: true },
          },
          {
            path: "gameinfo/:id",
            component: () => import("@/views/manage/gameM/gameInfo/index.vue"),
            meta: { title: "游戏详情", requiresAuth: true, isShowNav: false },
          },
          {
            path: "gameedit/:id",
            component: () => import("@/views/manage/gameM/gameEdit/index.vue"),
            meta: { title: "编辑游戏", requiresAuth: true, isShowNav: false },
          },
        ],
      },
      {
        path: "postmanage",
        redirect: "/postmanage/postlist",
        component: () => import("@/views/manage/postM/index.vue"),
        meta: {
          title: "帖子管理",
          menu: "帖子管理列表目录",
          requiresAuth: true,
          isShowNav: true,
        },
        children: [
          {
            path: "postlist",
            component: () => import("@/views/manage/postM/postList/index.vue"),
            meta: { title: "帖子列表", requiresAuth: true, isShowNav: true },
          },
          {
            path: "postinfo",
            component: () => import("@/views/manage/postM/postInfo/index.vue"),
            meta: { title: "帖子详情", requiresAuth: true, isShowNav: false },
          },
        ],
      },
      {
        path: "/ordermanage",
        component: () => import("@/views/manage/orderM/index.vue"),
        meta: { title: "订单管理", requiresAuth: true, isShowNav: true },
      },
      {
        path: "/miniomanage",
        component: () => import("@/views/manage/minioM/index.vue"),
        meta: { title: "MinIO存储管理", requiresAuth: true, isShowNav: true },
      },
      {
        path: "/help",
        component: () => import("@/views/help/index.vue"),
        meta: { title: "帮助", requiresAuth: true, isShowNav: true },
      },
      {
        path: "/user-center",
        component: () => import("@/views/userCenter/index.vue"),
        meta: { title: "个人中心", requiresAuth: true, isShowNav: false },
      },
    ],
  },
  {
    path: "/:pathMatch(.*)*",
    component: () => import("@/views/error/404/index.vue"),
    meta: { title: "404", requiresAuth: false, isShowNav: false },
  },
];

export default routes;
